/**
 * Created by Administrator on 2017/6/23 023.
 */
(function (angular) {
    /*创建模块*/
    var app = angular.module('app',['ui.router']);
    app.controller('AppController',['$scope','$window',function ($scope,$window) {
        /*项目的title*/
        $scope.title = '今日一刻';
        $scope.type = 'home';
        var navTitle = '首页';
        $scope.tabClick=function (type) {
            $scope.type = type;
            switch ($scope.type){
                case 'home':
                    navTitle = "首页";
                    break;
                case 'author':
                    navTitle = "作者";
                    break;
                case 'content':
                    navTitle = "栏目";
                    break;
                case 'my':
                    navTitle = '我的';
                    break;
            }
            $scope.$broadcast('navtitle',{navtitle:navTitle})
        }
        $scope.isback=function () {
            $window.history.back()

        }


    }])


})(angular);
